<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>变更单历史</title>
    <link href="/stylesheets/history.css" rel="stylesheet" />
</head>
<body>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title"><%=title%></h4>
</div>


<div class="head-warp">
    <div class="head">
        <div class="nav-box">
            <ul>
                <li class="cur" style="text-align:center; font-size:62px; font-family:'微软雅黑', '宋体';"></li>
            </ul>
        </div>
    </div>
</div>
<div class="main">
    <div class="history">
        <%for(var j=0; j<=maxTurnNum; j++){%>
        <div class="history-date">
            <ul>
                <h2 class="data01"><a href="#">第<%=j+1%>轮</a></h2>
                <%taskHis.forEach(function(tHis, item){%>
                <%if(tHis.turnNum == j){%>
                <%if(tHis.processStepId == 2){%>
                <li>
                    <h3>发起变更单</h3>
                    <dl>
                        <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>填写提交了变更单基本信息</span>
                        </dt>
                    </dl>
                </li>
                <%}else %>

                <%if(tHis.processStepId==2 && tHis.fileName){%>
                <li>
                    <h3>提取旧文件</h3>
                    <dl>
                        <dt>系统 &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>提取SVN上存在的旧文件：<a typeId="attaLink" href="<%=tHis.fileUri%>" style="color:#32B1EC"><%=tHis.fileName%></a></span>
                        </dt>
                    </dl>
                </li>
                <%}else %>

                <%if(tHis.processStepId==3 && tHis.fileName!=null){%>
                <li>
                    <h3>提交变更单</h3>
                    <dl>
                        <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>上传了变更单：<a typeId="attaLink" href="<%=tHis.fileUri%>" style="color:#32B1EC"><%=tHis.fileName%></a></span>
                        </dt>
                    </dl>
                </li>
                <%}else %>

                <%if(tHis.processStepId==4){%>
                    <%taskHis.forEach(function(tempHis, tempItem){%>
                        <%if(tempHis.turnNum==tHis.turnNum && tempHis.processStepId==5){%>
                            <li>
                                <h3>安排走查</h3>
                                <dl>
                                    <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                                        <span>指定<%=tempHis.realName%>对该变更单走查</span>
                                    </dt>
                                </dl>
                            </li>
                        <%}%>
                    <%});%>
                <%}else %>

                <%if(tHis.processStepId==5 && tHis.turnNum==maxTurnNum){%>
                    <%taskHis.forEach(function(tempHis, tempItem){%>
                        <%if(tempHis.turnNum==tHis.turnNum && tempHis.processStepId==6){%>
                            <li>
                                <h3>走查</h3>
                                <dl>
                                    <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                                        <span>走查该变更单后，做出“走查通过”的判定<br/>
                                            <%if(tHis.fileUri!=null){%>
                                                <label>上传了走查报告：<a typeId="attaLink" href="<%=tHis.fileUri%>" style="color:#32B1EC"><%=tHis.fileName%></a></label>。
                                            <%}%>
                                        </span>
                                    </dt>
                                </dl>
                            </li>
                        <%}%>
                    <%});%>
                <%}else %>

                <%if(tHis.processStepId==5 && tHis.turnNum<maxTurnNum){%>
                <li>
                    <h3>走查</h3>
                    <dl>
                        <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>走查该变更单后，做出“走查不通过”的判定。<br/>
                            <%if(tHis.fileUri!=null){%>
                            上传了走查报告：<a typeId="attaLink" href="<%=tHis.fileUri%>" style="color:#32B1EC"><%=tHis.fileName%></a><br/>
                            <%}%>
                            描述了不通过原因：<%if(tHis.noPassReason==null){%> 无<br/> <%}else{%>
                                                <%var n1 = tHis.noPassReason.length/20; var n2=tHis.noPassReason.length%20;%>
                                                <%if(n2!=0){n1 = Math.floor(n1)+1;}else{n1 = Math.floor(n1)}%>
                                                <%for(var jj=0; jj<n1; jj++){%>
                                                    <%=tHis.noPassReason.substr(jj*20,20)%><br/>
                                                <%}%>
                                            <%}%>
                            变更单退回“提交变更单”环节
                            </span>
                        </dt>
                    </dl>
                </li>
                <%}else %>

                <%if(tHis.processStepId==6 && tHis.dealer){%>
                <li>
                    <h3>上库</h3>
                    <dl>
                        <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>接受了上库任务</span>
                        </dt>
                    </dl>
                </li>
                <%}else %>

                <%if(tHis.processStepId==7){%>
                <li>
                    <h3>上库完成</h3>
                    <dl>
                        <dt><%=tHis.realName%> &nbsp;&nbsp;&nbsp;&nbsp;<time style="display:inline;color:#d3d3d3;font-weight:normal">(<%=tHis.execTime%>)</time>
                            <span>完成了代码上库任务</span>
                        </dt>
                    </dl>
                </li>
                <%}%>

                <%}%>
                <%});%>
            </ul>
        </div>
        <%}%>





        <!--<div class="history-date">-->
            <!--<ul>-->
                <!--<h2 class="date02"><a href="#">第n轮</a></h2>-->
                <!--<li>-->
                    <!--<h3>发起变更单1</h3>-->
                    <!--<dl>-->
                        <!--<dt>填写提交了变更单基本信息-->
                            <!--<span>处理人：XXX</span>-->
                        <!--</dt>-->
                    <!--</dl>-->
                <!--</li>-->
            <!--</ul>-->
        <!--</div>-->


    </div>
</div>


</body>
</html>


<script src="/javascripts/historyJs.js"></script>
<script>
    jQuery(document).ready(function() {
        //下载附件
        var aLink = $('[typeId=attaLink]');
        aLink.click(function(){
            var aHref = $(this).attr('href');
            var attaName = $(this).html();
            if(!aHref || '#'==aHref || null==aHref){
                return;
            }
            aHref = aHref.replace(/\./g,'%2E');
            aHref = aHref.replace(/\//g,'%2F');
            attaName = attaName.replace(/\./g,'%2E');
            attaName = attaName.replace(/\//g,'%2F');
            var currentUri = '/file/fileDownLoad/' + attaName + '/' + aHref;
            location.href = currentUri;
        });
    });
</script>

